#For use when trying to solve the DLP, and you have an upperbound for the exponent.
# Running time is O(sqrt(upperbound-lowerbound))
# So for example, with the following g and p, and with it being in range (1,2**46)
# This is for modular field, but can be adapted for any finite field.
p = 174807157365465092731323561678522236549173502913317875393564963123330281052524687450754910240009920154525635325209526987433833785499384204819179549544106498491589834195860008906875039418684191252537604123129659746721614402346449135195832955793815709136053198207712511838753919608894095907732099313139446299843
g = 41899070570517490692126143234857256603477072005476801644745865627893958675820606802876173648371028044404957307185876963051595214534530501331532626624926034521316281025445575243636197258111995884364277423716373007329751928366973332463469104730271236078593527144954324116802080620822212777139186990364810367977
A = 60599224471338675280892530751916349778515159413752423808328059701102187627870714718035966693602191072973114841123646111608872779841184094624255525186079109811898831481367089940015561846391171130215542875940992971840860585330764274682844976540740482087538338803018712681621346835893113300860496747212230173641
k = GF(p)
AInField = k(A)
gInField = k(g)
discrete_log_lambda(AInField,gInField,(1,2**46))
# returns 33657892424673 given enough time!
